home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16932 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: wcap.centerline.com!vajra!chase
  2. From: chase@centerline.com (David Chase)
  3. Newsgroups: comp.lang.smalltalk,comp.object,comp.lang.c++,comp.lang.java
  4. Subject: Re: The Good, the Bad, the Ugly, and the W
  5. Date: 12 Apr 1996 19:54:56 GMT
  6. Organization: CenterLine Software
  7. Distribution: world
  8. Message-ID: <4kmceg$76t@wcap.centerline.com>
  9. References: <RMARTIN.96Apr10133335@rcm.oma.com>
  10. Reply-To: chase@centerline.com
  11. NNTP-Posting-Host: vajra
  12.  
  13. In article 96Apr10133335@rcm.oma.com, rmartin@oma.com (Robert C. Martin) writes:
  14. > You missed my point.  new/delete can *always be made* to be completely
  15. > deterministic.  Consider:
  16.  
  17. > [user-written memory allocation]
  18.  
  19. > This is a typical strategy in real time systems.
  20.  
  21. There's nothing stopping you from doing this in a garbage-collected
  22. system, either.  I think that's why we missed your point, because it
  23. was trivial.  There's no rule against pre-allocating a bunch of
  24. objects in a garbage-collected system, and writing your own
  25.  
  26.   thing = my_alloc()
  27.  
  28. and 
  29.  
  30.   my_free(thing)
  31.  
  32. subroutines to move them on and off your private freelist as
  33. necessary.  You're getting no assistance from your garbage collector
  34. *for that particular piece of code* but it isn't interfering with you,
  35. either, and if you aren't allocating any memory, then the collector is
  36. not running.
  37.  
  38. There are also approximations to real-time garbage collection
  39. available, though if I understand correctly, microsecond-level
  40. deadlines are still difficult to meet.
  41.  
  42. speaking for myself,
  43.  
  44. David Chase
  45.  
  46.